<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBundleRequestLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('bundle_request_logs', function (Blueprint $table) {
            $table->bigIncrements('id');                    // 日志id
            $table->bigInteger('app_id')
                  ->comment('apikey的id');                  // apikey的id
            $table->string('host');                         // 发起请求的host
            $table->string('url');                          // 发起请求的url
            $table->string('params');                       // 发起请求携带的参数
            $table->boolean('success')->default(false);     // 请求成功与否
            $table->string('error');                        // 错误信息
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('bundle_request_logs');
    }
}
